vue中引用echarts出现TypeError: Cannot read property 'getAttribute' of undefined | 您所在的位置:网站首页 › vue echarts getattribute null › vue中引用echarts出现TypeError: Cannot read property 'getAttribute' of undefined |
this.$nextTick(() => { xxx }); 解决vue中引用echarts出现"TypeError: Cannot read property 'getAttribute' of undefined"错误。 在调用echarts的位置直接使用上述方法即可,不需要像很多人说的非要在 "mounted"之中调用。 例如(详情可以参考vue官网 https://cn.vuejs.org/v2/api/): //统计图 statistics (args) { ............ this.dialogVisible = true; //调用echarts的方法 this.$nextTick(()=>{ this.detailStatistics(); }); });
|
CopyRight 2018-2019 实验室设备网 版权所有 |